home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 2000 April / MACPOWER-2000-04.ISO.7z / MACPOWER-2000-04.ISO / ODNスターターキット / Microsoft Internet 4.5 / インターネット接続ウィザード4.5 / Internet Setup / Modem Scripts / 3Com Impact ISDN 56K / 3Com Impact ISDN 56K next >
Text File  |  1999-05-24  |  5KB  |  277 lines

  1. !  3Com Impact ISDN 56K
  2. !    Author:    Kris Kreutzman
  3. !
  4. !    Copyright:    ゥ 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !        v2.1    as shipped with the ARA 2.1
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  11. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  12. !    byte 3 == 40 -> max number of chars in varstr 7
  13. !    byte 4 == 40 -> max number of chars in varstr 8
  14. !    byte 5 == 40 -> max number of chars in varstr 9
  15. !    
  16. @ORIGINATE
  17. @ANSWER
  18. !
  19. ! ---- Initial modem setup ----
  20. !
  21. ! Set serial port speed
  22. serreset 57600, 0, 8, 1
  23. !
  24. @LABEL 2
  25. hsreset 0 0 0 0 0 0
  26. settries 0
  27. !
  28. ! Get the modem's attention
  29. !
  30. matchclr
  31. matchstr 1 3 "OK¥13¥10"
  32. write "AT¥13"
  33. matchread 30
  34. !
  35. @LABEL 3
  36. !
  37. ! Setup the modem for the following:
  38. !   Reset to factory settings
  39. !   Standard compression/reliablity
  40. !   Lock serial port speed
  41. !   Serial port hardware handshaking, turn off software handshaking
  42. !   Verbose responces and compression/protocol results
  43. !   CONNECT returns DCE speed
  44. !   Turn off answering
  45. !   Reset or return to command mode on DTR toggle (optional)
  46. !
  47. matchclr
  48. matchstr 1 4   "OK¥13¥10"
  49. matchstr 2 101 "ERROR¥13¥10"
  50. write "AT&FE0S0=0¥13"
  51. matchread 30
  52. inctries
  53. iftries 3 101
  54. !
  55. ! Reset the Modem on setup failure
  56. !
  57. DTRClear
  58. pause 5
  59. DTRSet
  60. flush
  61. jump 3
  62. !
  63. !
  64. @LABEL 4
  65. !
  66. ! Modem ready, wait for a call or originate a call
  67. !
  68. @LABEL 13
  69. ifANSWER 32
  70. !
  71. !
  72. ! ---- Originating a call ----
  73. !
  74. @LABEL 19
  75. ! Display the full dialstring contained in Varstring 1
  76. note "Dialing ^1" 3
  77. !
  78. ! Varstrings 7, 8 and 9, contain dialstring fragments
  79. !    Long phone numbers may need to be split into smaller groups
  80. !    for the modem to use
  81. !
  82. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  83. ! Varstring 8 == blank (dialstring in varstring 7)
  84. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  85. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  86. ifstr 8 27 " "
  87. ifstr 9 24 " "
  88. !
  89. !  Write dialstring in varstrings 7, 8 & 9
  90. matchclr
  91. matchstr 1 21 "OK¥13¥10"
  92. write "ATD^7;¥13"
  93. matchread 400
  94. jump 101
  95.  
  96. @LABEL 21
  97. matchclr
  98. matchstr 1 22 "OK¥13¥10"
  99. write "ATD^8;¥13"
  100. matchread 400
  101. jump 101
  102.  
  103. @LABEL 22
  104. write "ATD^9¥13"
  105. jump 32
  106. !
  107. !
  108. @LABEL 24
  109. !  Write dialstring in varstrings 7 & 8
  110. matchclr
  111. matchstr 1 25 "OK¥13¥10"
  112. write "ATD^7;¥13"
  113. matchread 400
  114. jump 101
  115.  
  116. @LABEL 25
  117. write "ATD^8¥13"
  118. jump 32
  119. !
  120. @LABEL 27
  121. !  Write dialstring in varstring 7
  122. write "ATD^7¥13"
  123. !
  124. !
  125. !    ---- Connection responce ----
  126. !
  127. ! The following section will parse modem responces:
  128. !
  129. @LABEL 32
  130. matchclr
  131. matchstr  1  81 "RING¥13¥10"
  132. matchstr  2 102 "NO DIALTONE¥13¥10"
  133. matchstr  3 103 "NO CARRIER"
  134. matchstr  4 103 "ERROR¥13¥10"
  135. matchstr  5 104 "BUSY¥13¥10"
  136. matchstr  6 105 "NO ANSWER¥13¥10"
  137. matchstr  7  33 "CARRIER "
  138. matchstr  8  34 "CONNECT "
  139. matchread 700
  140. ifANSWER 32
  141. jump 105
  142. !
  143. @LABEL 33
  144. matchclr
  145. matchstr  1  56 "56000"
  146. matchstr  2  58 "64000"
  147. matchread 10
  148. jump 32
  149. !
  150. @LABEL 34
  151. matchclr
  152. matchstr  1  56 "56000"
  153. matchstr  2  58 "64000"
  154. matchread 10
  155. jump 60
  156. !
  157. ! -- Connection rates --
  158. ! CommunicatingAt informs ARA of the raw modem to modem
  159. ! connection speed.
  160. @LABEL 56
  161. note "Communicating at 56000 bps." 2
  162. CommunicatingAt 56000
  163. jump 60
  164. !
  165. @LABEL 58
  166. note "Communicating at 64000 bps." 2
  167. CommunicatingAt 64000
  168. jump 60
  169. !
  170. !
  171. ! -- Normal exit after "CONNECT" --
  172. !
  173. !  This modem has been setup to do CTS handshaking,
  174. !  and we assume that a CTS handshaking cable is being used.
  175. !
  176. @LABEL 60
  177. ! Turn on CTS handshaking.
  178. HSReset 0 1 0 0 0 0
  179. !
  180. ifANSWER 71
  181. pause 30
  182. @LABEL 71
  183. exit 0
  184. !
  185. !
  186. ! ---- Answer calls ----
  187. !
  188. !    A RING result from the modem and in ANSWERING mode
  189. !    claims the serial port and answering the phone
  190. !
  191. @LABEL 81
  192. ifORIGINATE 32
  193. userhook 1
  194. note "Answering phone..." 2
  195. write "ATA¥13"
  196. jump 32
  197. !
  198. !
  199. ! ---- Hang up and reset modem ----
  200. !
  201. @HANGUP
  202. @LABEL 90
  203. settries 0
  204. HSReset 0 0 0 0 0 0
  205. !
  206. @LABEL 92
  207. !  Escape from data to command mode
  208. matchclr
  209. matchstr 1 96 "OK¥13¥10"
  210. write "+++"
  211. matchread 20
  212. !
  213. @LABEL 94
  214. ! Force a hangup
  215. matchclr
  216. matchstr 1 98 "NO CARRIER¥13¥10"
  217. matchstr 2 98 "OK¥13¥10"
  218. matchstr 3 98 "ERROR¥13¥10"
  219. matchstr 4 98 "0¥13¥10"
  220. write "ATH¥13"
  221. matchread 30
  222. ! Try to get control of the modem by toggling DTR
  223. DTRClear
  224. pause 5
  225. DTRSet
  226. flush
  227. !
  228. ! Try the hangup sequence three times otherwise declare and error
  229. inctries
  230. iftries 3 101
  231. jump 92
  232. !
  233. @LABEL 96
  234. ! Pause between data and command mode
  235. pause 50
  236. jump 94
  237. !
  238. !
  239. @LABEL 98
  240. ! Recall the factory settings
  241. pause 15
  242. matchclr
  243. matchstr 1 99 "OK¥13¥10"
  244. write "AT&F¥13"
  245. matchread 30
  246. jump 101
  247. !
  248. @LABEL 99
  249. exit 0
  250. !
  251. ! ---- Error messages -----
  252. !
  253. ! Modem Not Responding
  254. @LABEL 101
  255. exit -6019
  256. !
  257. ! No Dial Tone
  258. @LABEL 102
  259. exit -6020
  260. !
  261. ! No Carrier or Error
  262. @LABEL 103
  263. exit -6021
  264. !
  265. ! Busy
  266. @LABEL 104
  267. exit -6022
  268. !
  269. ! No Answer
  270. @LABEL 105
  271. exit -6023
  272. !
  273. ! User Cancellation
  274. @LABEL 107
  275. exit -6008